<template>
  <div>
    <div ref="myChart" style="height: 300px;" />
  </div>
</template>

<script>
// import * as echarts from 'echarts'
import * as echarts from 'echarts/core'
import { TooltipComponent } from 'echarts/components'
import { RadarChart } from 'echarts/charts'
import { CanvasRenderer } from 'echarts/renderers'
echarts.use([TooltipComponent, RadarChart, CanvasRenderer])
export default {
  mounted() {
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(this.$refs.myChart)
    // 绘制图表
    const option = {
      textStyle: {
        fontSize: 16
      },

      radar: {
        // shape: 'circle',
        indicator: [
          { name: '销售额', max: 6500 },
          { name: '技术支出', max: 16000 },
          { name: '日常消费报销', max: 30000 },
          { name: '活动支出', max: 38000 },
          { name: '营业额', max: 52000 },
          { name: '利润', max: 25000 }
        ]
      },
      // 鼠标移入显示
      tooltip: {
        trigger: 'item'
      },
      series: [
        {
          type: 'radar',
          data: [
            {
              value: [4200, 3000, 20000, 35000, 50000, 18000],
              name: '个人支出'
            },
            {
              value: [5000, 14000, 28000, 26000, 42000, 21000],
              name: '公司支出'
            }
          ]
        }
      ]
    }

    myChart.setOption(option)
  }
}
</script>

<style>

</style>
